package cn.qn.dto.security;

import cn.qn.moudle.security.Resource;
import javax.validation.constraints.NotNull;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

@Data
public class ResourceDTO implements Serializable,Comparable {

    private static final long serialVersionUID = 8492326796226844506L;
    private Integer id;
	private String name;
	private String code;
	private Integer parentId;
	private List<Resource> children;

	@Override
	public int compareTo(@NotNull Object o) {
		ResourceDTO dto = (ResourceDTO)o;
		return this.id.compareTo(dto.getId());
	}
}
